<?php

use App\Http\Controllers\SearchController;
use Illuminate\Support\Facades\Route;

Route::view('/', 'welcome')->name('welcome');

Route::get('/actors', \App\Livewire\ActorList::class)->name('actors.index');
Route::get('/actors/{actor}', \App\Livewire\ActorShow::class)->name('actors.show');

Route::get('/categories', \App\Livewire\CategoryList::class)->name('categories.index');
Route::get('/categories/{category}', \App\Livewire\CategoryShow::class)->name('categories.show');

Route::get('/videos', \App\Livewire\VideoList::class)->name('videos.index');
Route::get('/videos/{video}', \App\Livewire\VideoShow::class)->name('videos.show');

Route::get('/favorites', \App\Livewire\FavoriteList::class)->name('favorites.index');

Route::get('/specials', \App\Livewire\SpecialList::class)->name('specials.index');
Route::get('/specials/{special}', \App\Livewire\SpecialShow::class)->name('specials.show');

Route::get('/login', \App\Livewire\Auth\Login::class)->name('login')->middleware('guest');
Route::get('/register', \App\Livewire\Auth\Register::class)->name('register')->middleware('guest');
Route::get('/logout', \App\Http\Controllers\LogoutController::class)->name('logout')->middleware('auth');

Route::get('/home', \App\Livewire\UserHome::class)->name('home');

Route::get('/search', [SearchController::class, 'index'])->name('search.index');
Route::post('/search', [SearchController::class, 'history'])->name('search.history');
Route::get('/search/history/clear', [SearchController::class, 'clear'])->name('search.clear');

Route::get('/share', \App\Livewire\Share::class)->name('share')->middleware('auth');
Route::get('/agreement', \App\Livewire\Agreement::class)->name('agreement');
